package com.tingyuge.base.structrue.segmenttree;

/**
 * @Created by xiaodao
 */
public class Main {
    public static void main(String[] args) {
        Integer[] nums= {-2,0,5,-5,2,-1};

        SegmentTree<Integer> segmentTree = new SegmentTree<>(nums,(a,b)-> a+b);
        System.out.println(segmentTree);
        System.out.println(segmentTree.query(0,3));
        System.out.println(segmentTree.query(1,3));

        System.out.println(segmentTree.query(3,5));

    }
}
